<!doctype html>
<html>
<head>
    <include file="public/head"/>
    <title>ThinkCMF插件 采集插件</title>
    <meta name="description" content="ThinkCMF插件 采集插件">
    <meta name="keywords" content="ThinkCMF插件 采集插件">
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{$site.sitename} <span class="caret"></span></a>
            <ul class="dropdown-menu">
            <li><a href="{:url('/plugin/crawler/admin_rule/index',array('crawler_site_id'=>$siteid))}">采集规则</a></li>
            <li><a href="{:url('/plugin/crawler/admin_rule/add',array('crawler_site_id'=>$siteid))}">添加规则</a></li>
            <li><a href="{:url('/plugin/crawler/admin_url/index',array('crawler_site_id'=>$siteid))}">采集列表</a></li>
            <li><a href="{:url('/plugin/crawler/admin_collection/index',array('crawler_site_id'=>$siteid))}">采集数据</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="{:url('/plugin/crawler/admin_index/index')}">切换站点</a></li>
            </ul>
        </li>
        <li class="active"><a>编辑规则</a></li>
    </ul>

    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('/plugin/crawler/admin_rule/editPost/crawler_site_id/'. $siteid, array('id'=>$rule->id))}">
        <div class="form-group">
            <label for="input-rulename" class="col-sm-2 control-label"><span class="form-required">*</span>规则名</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-rulename" name="rulename" value="{$rule->rulename}">
            </div>
        </div>
        <div class="form-group">
            <label for="input-listpath" class="col-sm-2 control-label"><span class="form-required">*</span>列表规则</label>
            <div class="col-md-6 col-sm-10">
                <textarea type="text" class="form-control" id="input-listpath" name="listpath" >{$rule->listpath}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="input-pagepath" class="col-sm-2 control-label"><span class="form-required">*</span>内容规则</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-pagepath" name="pagepath" value="{$rule->pagepath}" placeholder="">
            </div>
        </div>
        
        <div class="form-group">
            <label for="input-user_email" class="col-sm-2 control-label"><span class="form-required">*</span>文章分类</label>
            <div class="col-md-6 col-sm-10">
                <select class="form-control" name="category_id" id="input-category_id">
                    <foreach name="categories" item="vo">
                        <php>$category_selected = $rule->category_id == $vo->id ? "selected" : "";</php>
                        <option value="{$vo->id}" {$category_selected}>{$vo->name}</option>
                    </foreach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="input-dictionary_id" class="col-sm-2 control-label"><span class="form-required">*</span>核心词</label>
            <div class="col-md-6 col-sm-10">
                <select class="form-control" name="dictionary_id" id="input-dictionary_id">
                    <option value="0">请选择</option>
                    <foreach name="dictionaries" item="vo">
                        <php>$dictionary_selected = $rule->dictionary_id == $vo->id ? "selected" : "";</php>
                        <option value="{$vo->id}"{$dictionary_selected}>{$vo->keyword}</option>
                    </foreach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
   
</div>
<include file="public/scripts"/>
</body>
</html>